﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<table cellpadding="0" cellspacing="0" style="width:100%" >
    <tr>
		<td style="background-image:url(../../Content/Images/Admin/backgr.gif); height:60px; text-align:center">
            <a href="<%= Url.Action("Index", "Home") %>" style="text-decoration: none;">
                <span style="color: #cc0000; font-size: 25px; font-weight: bold; "><%= WebConfiguration.SiteName %></span>
            </a>
        </td>
	</tr>
	<tr>
		<td style="height:1px; background-color:#484883"></td>
	</tr>
                		
	<tr>
		<td style="vertical-align:top; padding:0px;">
			<%--<div id="lefttreeholder" class="dtree" style="width:300px; height:300px; margin:2px 0 0 5px; overflow:auto">
			<div style="width:600px">--%>
			<div style="margin:5px;">

				<script type="text/javascript">
					//<!--
					//<%--(id, pid, name, url, title, target, icon, iconOpen, open) --%>
					d = new dTree('d');
					d.add(0, -1, ' Administration&nbsp;(<a href="javascript: d.openAll();"><u>expand all</u></a>&nbsp;<a href="javascript: d.closeAll();"><u>collapse all</u></a>)');
					d.add(1, 0, 'Tỉnh thành', '../Admin/SelectTinhThanh');
					<% for (int i=0; i<Model.TinhThanhModel.GetModel.LstObjModel.Count; i++){ %>
                        d.add(1<%= i %>, 1, '<%= Model.TinhThanhModel.GetModel.LstObjModel[i].ObjModel.TenTinhThanh %>', '../Admin/SelectQuanHuyenByTinhThanh?idtinhthanh=<%= Model.TinhThanhModel.GetModel.LstObjModel[i].ObjModel.ID %>');
                    <% } %>
                    d.add(2, 0, 'Loại bất động sản', '../Admin/SelectLoaiBatDongSan');
                    <% for (int i=0; i<Model.LoaiBatDongSanModel.GetModel.LstObjModel.Count; i++){ %>
                        d.add(2<%= i %>, 2, '<%= Model.LoaiBatDongSanModel.GetModel.LstObjModel[i].TenLoaiBatDongSan %>', '');
                        <% for (int j=0; j<Model.TinhThanhModel.GetModel.LstObjModel.Count; j++){ %>
                            d.add(2<%= i %><%= j %>, 2<%= i %>, '<%= Model.TinhThanhModel.GetModel.LstObjModel[j].ObjModel.TenTinhThanh %>', '');
                            <% for (int k=0; k<Model.TinhThanhModel.GetModel.LstObjModel[j].QuanHuyens.Count; k++){ %>
                                d.add(2<%= i %><%= j %><%= k %>, 2<%= i %><%= j %>, '<%= Model.TinhThanhModel.GetModel.LstObjModel[j].QuanHuyens[k].TenQuanHuyen %>', '../Admin/SelectNhaDatByLoaiBatDongSanQuanHuyen?idloaibatdongsan=<%= Model.LoaiBatDongSanModel.GetModel.LstObjModel[i].ID %>&idquanhuyen=<%= Model.TinhThanhModel.GetModel.LstObjModel[j].QuanHuyens[k].ID %>');
                            <% } %>
                        <% } %>
                    <% } %>
                    d.add(4, 0, 'Loại cẩm nang', '../Admin/SelectLoaiCamNang');
                    <% for (int i=0; i<Model.LoaiCamNangModel.GetModel.LstObjModel.Count; i++){ %>
                        d.add(4<%= i %>, 4, '<%= Model.LoaiCamNangModel.GetModel.LstObjModel[i].TenLoaiCamNang %>', '../Admin/SelectCamNangByLoaiCamNang?idloaicamnang=<%= Model.LoaiCamNangModel.GetModel.LstObjModel[i].ID %>');
                    <% } %>
                    d.add(5, 0, 'Loại tin tức', '../Admin/SelectLoaiTinTuc');
                    <% for (int i=0; i<Model.LoaiTinTucModel.GetModel.LstObjModel.Count; i++){ %>
                        d.add(5<%= i %>, 5, '<%= Model.LoaiTinTucModel.GetModel.LstObjModel[i].TenLoaiTinTuc %>', '../Admin/SelectTinTucByLoaiTinTuc?idloaitintuc=<%= Model.LoaiTinTucModel.GetModel.LstObjModel[i].ID %>');
                    <% } %>
                    d.add(3, 0, 'Loại giá', '../Admin/SelectLoaiGia');
                    d.add(6, 0, 'Thông tin công ty', '../Admin/SelectThongTinCongTy');
                    d.add(7, 0, 'Người dùng', '../Admin/SelectNguoiDung?role=<%= Roles.GetRolesForUser(Page.User.Identity.Name)[0] %>');
                    d.add(8, 0, 'Liên kết', '../Admin/SelectLienKet');
                    d.add(9, 0, 'Hộp thư', '../Admin/SelectHopThu');
					d.config.useLines = true;
					document.write(d);
					//d.openAll();
					//-->
				</script>
			</div>
                					
		</td>
		<td style="background-image:url(../../Content/Images/Admin/backgr.gif); height: 23px;"></td>
	</tr>
</table>
